package cn.edu.scau.cmi.zhangxiyang.client;

import java.net.URL;
import java.util.ResourceBundle;

import javafx.application.Application;
import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.stage.Stage;

public class FinalClient extends Application{
	public void start(Stage primaryStage) {
        try {
            Parent root = FXMLLoader.load(getClass().getClassLoader()
                    .getResource("cn/edu/scau/cmi/zhangxiyang/client/Client.fxml"));
            
            primaryStage.setTitle("综合性实验");
            primaryStage.setScene(new Scene(root));
            primaryStage.show();

        } catch(Exception e) {
            e.printStackTrace();
        }
    }

    public static void main(String[] args) {
        launch(args);
    }
    
    public void initialize(URL location, ResourceBundle resources) {
	       // TODO (don't really need to do anything here).
	}
    
    @FXML
    private Button Singleton;
    
    @FXML
    private Button Interface;
    
    @FXML
    private Button SimpleFactory;
    
    @FXML
    private Button Factory;
    
    @FXML
    private Button AbstractFactory;
    
    @FXML
    private Button Adapter;	
    
    @FXML
    private Button Composite;
    
    @FXML
    private Button Hibernate;
    
    @FXML
    private Button Spring;
    
    @FXML
    private Button SandH;

    public void Singleton_Click(ActionEvent event) {
		SingletonClient singletonclient = new SingletonClient();
		singletonclient.start(new Stage());
    }
    
    public void Interface_Click(ActionEvent event) {
    	InterfaceProgrammingClient InterfaceProgrammingClient = new InterfaceProgrammingClient();
    	InterfaceProgrammingClient.start(new Stage());
    }

	public void SimpleFactory_Click(ActionEvent event) {
		SimpleFactoryClient simplefactory = new SimpleFactoryClient();
		simplefactory.start(new Stage());
	}

	public void Factory_Click(ActionEvent event) {
		FactoryMethodClient factory = new FactoryMethodClient();
		factory.start(new Stage());
	}

	public void AbstractFactory_Click(ActionEvent event) {
		AbstractFactoryClient abstractfactory = new AbstractFactoryClient();
		abstractfactory.start(new Stage());
	}

	public void Adapter_Click(ActionEvent event) {
		AdapterClient adapter = new AdapterClient();
		adapter.start(new Stage());
	}

	public void Compsite_Click(ActionEvent event) {
		SafeCompositeClient composite = new SafeCompositeClient();
		composite.start(new Stage());
	}

	public void Hibernate_Click(ActionEvent event) {
		ComprehensionClient hibernate = new ComprehensionClient();
		hibernate.start(new Stage());
	}

	public void Spring_Click(ActionEvent event) {
		SpringClient spring = new SpringClient();
		spring.start(new Stage());
	}
	
	public void SandH_Click(ActionEvent event) {
		SpringandHibernateClient SH = new SpringandHibernateClient();
		SH.start(new Stage());
	}
    
}
